{*
Change logs
- Sep 13, 2011 - trungdt - Add chain to article module
*}
<link rel="stylesheet" type="text/css" href="{$smarty.const.THEME_RELATIVE}modules/depmodule/css/depmodule.css">

<div id="content" class="column">
	<div class="section"> 
		{if $current_node->dont_show_info == 0}
			{$main_content}
		{/if}
		{* 
			Sep 13, 2011
			Chain article module *}
		{if $config->list_sub == 1}
			{chain module='articlemodule' view='_Default_for_Depmodule' src=$current_node->article_src}
		{/if}
	</div>
</div> <!-- /.section, /#content --> 

<div class="region region-sidebar-first column sidebar">
	<div class="section"> 
		<div id="block-menu_block-12" class="block block-menu_block region-odd odd region-count-1 count-1"><div class="block-inner">
				<div class="content">
					<h2 class="title"><a href="{$dep_link}" title="{$config->dep_name}" class="active-trail active">{$config->dep_name}</a></h2>
					<div class="menu-block-2 menu-name-primary-links">
						<ul class="menu">
							{assign var=startdepth value=0}
							{foreach name="children" key=key from=$links item=section}
							{assign var=nextkey value=`$key+1`}
							{assign var=previouskey value=`$key-1`}

							{if $links[$previouskey]->depth < $section->depth && $smarty.foreach.children.first!=true}
							<ul class="menu">
								{/if}

								<li class="{if $section->expanded == 1}expanded active-trail{else}leaf{/if}">
									<span class="depmodule_controlaction">
									{permissions level=$smarty.const.UILEVEL_NORMAL}
									{if $permissions.edit == 1 || $permissions.delete == 1}
										{if $permissions.create == 1}
										<a href="{link action=edit parent=$section->id}"><img class="mngmnt_icon" src="{$smarty.const.ICON_RELATIVE}add.png" title="{$_TR.alt_create}" alt="{$_TR.alt_create}" /></a>
										{/if}
										{if $permissions.edit == 1}
										<a href="{link action=edit id=$section->id}"><img class="mngmnt_icon" src="{$smarty.const.ICON_RELATIVE}edit.png" title="{$_TR.alt_edit}" alt="{$_TR.alt_edit}" /></a>
										{/if}
										{if $permissions.delete == 1}
										<a href="{link action=delete id=$section->id}"><img class="mngmnt_icon" src="{$smarty.const.ICON_RELATIVE}delete.png" title="{$_TR.alt_delete}" alt="{$_TR.alt_delete}" onclick="return confirm('{$_TR.delete_link_confirm}');" /></a>
										{/if}
										{*if $smarty.foreach.children.first == 0}
										<a href="{link action=rank_switch type=0 id=$section->id}">            
											<img src="{$smarty.const.ICON_RELATIVE}up.png" title="{$_TR.alt_previous}" alt="{$_TR.alt_previous}" />
										</a>
										{/if}
										{if $smarty.foreach.children.last == 0}
										<a href="{link action=rank_switch type=1 id=$section->id}">
											<img src="{$smarty.const.ICON_RELATIVE}down.png" title="{$_TR.alt_next}" alt="{$_TR.alt_next}" />
										</a>
										{/if*}
									{/if}
									{/permissions}
									</span>    
									<a {if $section->expanded == 1}class="{if $section->active ==1}active{/if} active-trail"{/if} href="{link action=view id=$section->seo_name}">{$section->title}</a>
									{if $links[$nextkey]->depth == $section->depth}
								</li>
								{/if}

								{if $links[$nextkey]->depth < $section->depth}
								{if $smarty.foreach.children.last==true}
								{assign var=nextdepth value=$startdepth}
								{else}
								{assign var=nextdepth value=$links[$nextkey]->depth}
								{/if}
								{math equation="x-y" x=$section->depth y=$nextdepth assign=looper}
								{section name="close" loop=$looper}
								</li>
							</ul>
							{/section}
							</li>
							{/if}
							{/foreach}
						</ul>
					</div>
					<div class="depmodule action">
						{permissions level=$smarty.const.UILEVEL_NORMAL}
						{if $permissions.create == 1}
						<a class="create" href="{link action=edit}">New Node</a>
						{/if}
						{/permissions}
					</div>    

					{* Show link tree here *}

					{* End of show link tree *}
					{* Chain show module *}
					{chain module='containermodule' view='Default' src=$config->chain_src}
					{literal}
					<script id="_wau5lf">var _wau = _wau || []; _wau.push(["map", "40l7lt1wnpku", "5lf", "203", "100", "cart" , "diamond-yellow"]);(function() { var s=document.createElement("script");s.src="http://widgets.amung.us/map.js"; s.async=true; document.getElementsByTagName("head")[0].appendChild(s); })();</script>
					{/literal}
				</div>     
			</div>
		</div> <!-- /block-inner, /block --> 
	</div>
</div> <!-- /.section, /.region --> 